<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<div id="dialog-register" title="注册" style="background:white;width:400px">
  <div id="signup">
    <div id="dialog-popup" class="signup-box">
      <div class="sect">
        <s:action name="listCity" namespace="/" id="listCity"/>
        <s:form id="register-form" method="post" action="register" namespace="/" theme="simple" validate="true">

          <div class="field email">
            <label for="txtEmail">Email</label>
            <s:textfield id="txtEmail" name="user.email" cssClass="f-input"
                         required="true"/>
            <s:fielderror cssClass="field-error">
              <s:param>user.email</s:param>
            </s:fielderror>
            <span class="hint">用于登录及找回密码，不会公开，请放心填写</span>
          </div>
          <div class="field username">
            <label for="txtUsername">用户名</label>
            <s:textfield id="txtUsername" name="user.username" cssClass="f-input" maxlength="16"
                         required="true"/>
            <s:fielderror cssClass="field-error">
              <s:param>user.username</s:param>
            </s:fielderror>
            <span class="hint">填写4-16个字符，一个汉字为两个字符</span>
          </div>
          <div class="field password">
            <label for="txtPassword">密码</label>
            <s:password id="txtPassword" name="user.password" cssClass="f-input" maxlength="20"
                        required="true"/>
            <s:fielderror cssClass="field-error">
              <s:param>user.password</s:param>
            </s:fielderror>
            <span class="hint">为了您的帐号安全，建议密码最少设置为6个字符以上</span>
          </div>
          <div class="field password">
            <label for="txtPasswordConfirm">确认密码</label>
            <s:password id="txtPasswordConfirm" name="user.passwordConfirm" cssClass="f-input"
                        maxlength="20" required="true"/>
            <s:fielderror cssClass="field-error">
              <s:param>user.passwordConfirm</s:param>
            </s:fielderror>
            <span class="hint">必须输入相同的密码</span>
          </div>
          <div class="field">
            <label for="txtMobile">手机号码</label>
            <s:textfield id="txtMobile" name="user.mobile" cssClass="f-input"
                         maxlength="11" required="true"/>
            <s:fielderror cssClass="field-error">
              <s:param>user.mobile</s:param>
            </s:fielderror>
            <span class="hint">手机号码是我们联系您的重要方式，用于优惠券的短信通知</span>
          </div>
          <div class="field city">
            <label id="select-city">所在城市</label>
            <select class="tf-input" name="cityName">
              <s:iterator id="city" value="#listCity.cities">
                <option><s:property value="#city.chnName"/></option>
              </s:iterator>
            </select>
            <s:fielderror cssClass="field-error">
              <s:param>user.city</s:param>
            </s:fielderror>
            <span class="hint">根据您所在城市，我们将提供相应的团购信息</span>
          </div>
          <div class="field validationCode">
            <label>验证码</label>
            <s:textfield id="txtValidationCode" name="validation" cssClass="tf-input"
                         maxlength="4" required="true"/>
            &nbsp;&nbsp;
            <img id="validation_image" src="/validationCode.action" style="height:30px"
                 onclick="this.src='/validationCode.action?a=' + Math.random()"/>
            <s:fielderror cssClass="field-error">
              <s:param>validation</s:param>
            </s:fielderror>
          </div>
          <div class="act">
            <s:submit value="同意用户协议并注册" name="commit" id="submit" cssClass="formsubmit"/>
          </div>
        </s:form>
      </div>
    </div>
  </div>
</div>